package cn.sunyblog.tool.threadpool;

/**
 * 任务包装器，用于记录任务提交时间
 * 
 * @author sunyblog
 */
public class TaskWrapper implements Runnable {
    
    private final Runnable task;
    private final long submitTime;
    
    public TaskWrapper(Runnable task) {
        this.task = task;
        this.submitTime = System.currentTimeMillis();
    }
    
    @Override
    public void run() {
        task.run();
    }
    
    public long getSubmitTime() {
        return submitTime;
    }
    
    public Runnable getOriginalTask() {
        return task;
    }
}